package com.hp.springaop01;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestAOP {

    public static void main(String[] args) {
        //创建应用程序上下文
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("spring-aop.xml");

        //获得对象
        Programmer programmer = context.getBean(Programmer.class);
        programmer.study();
        programmer.program();
        programmer.walk(100);

        Student student = context.getBean(Student.class);
        student.eat();
        student.study();
        student.walk();
    }
}
